package com.gopay.common.core.dic.dao.banklimit.impl;

import com.gopay.common.base.dao.impl.BaseDAOImpl;
import com.gopay.common.core.dic.dao.banklimit.BankLimitReadDao;
import com.gopay.common.domain.banklimitquery.BankLimitInfo;
import org.springframework.stereotype.Component;
import org.springframework.stereotype.Repository;

import javax.annotation.Resource;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 * CLASSNAME:BankLimitReadDaoImpl
 * Description:银行限额查询实现类
 * DATE:2017/5/27/027
 * AUTHER:PANSHICHAO
 * www.gopay.com.cn Inc.All rights reserved.
 */
@Repository("bankLimitReadDao")
public class BankLimitReadDaoImpl extends BaseDAOImpl<BankLimitInfo,String> implements BankLimitReadDao {
    @Override
    public List<BankLimitInfo> showAllBankLimitByBankProductCode(String bankProductCode){
        Map<String,Object> param = new HashMap<String,Object>();
        String hql = "from BankLimitInfo where bankProductCode=:bankProductCode and infoStat = '1'";
        param.put("bankProductCode",bankProductCode);
        List<BankLimitInfo> resultList = super.findByHql(hql,param);
        if(resultList.size()!=0){
            return resultList;
        }else{
            return null;
        }
    }
}
